<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>团购</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link type="text/css" rel="stylesheet"
	href="/EasyBuy/statics/css/style.css" />
<script type="text/javascript"
	src="/EasyBuy/statics/js/jquery-1.11.1.min_044d0927.js"></script>
<script type="text/javascript"
	src="/EasyBuy/statics/js/jquery.bxslider_e88acd1b.js"></script>

<script type="text/javascript"
	src="/EasyBuy/statics/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/EasyBuy/statics/js/menu.js"></script>

<script type="text/javascript" src="/EasyBuy/statics/js/lrscroll_1.js"></script>


<script type="text/javascript" src="/EasyBuy/statics/js/n_nav.js"></script>

<script type="text/javascript" src="/EasyBuy/statics/js/s_ban.js"></script>


</head>
<script type="text/javascript"
		src="/EasyBuy/statics/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		function hideType(){
			$(".leftNav").hide();
		}
		hideType();
		
		//特卖品牌
		$(".sell_brand").html("");
		$.getJSON("SellServlet","opr=sellBrandInfos",callBackBrand);
		function callBackBrand(dataBrand){
			for(var i=0;i<dataBrand.length;i++){
				$(".sell_brand").append("<li>"+
								"<div class='con'>"+
									"<div class='simg'>"+
										"<img src='/EasyBuy/statics/images/"+dataBrand[i].brand_url+"' width='220'"+
										"height='100' class='img1'/>"+
									"</div>"+
									"<div class='ch_bg'>"+
										"<span class='ch_txt'>先领券再消费</span> <a href='BrandServlet?opr=brandIdLists&id="+dataBrand[i].brand_id+"' class='ch_a'>查看</a>"+
									"</div>"+
									"09月12日 — 10月20日"+
								"</div>"+
								"<div class='img'>"+
									"<img src='/EasyBuy/statics/images/tm"+(i+1)+".jpg' width='530'"+
									"height='190' class='img2' />"+
								"</div>"+
							"</li>");
			}
		}
		$(".im").click(function() {
			location.href="/EasyBuy/pre/product/Brand.jsp";
			
			
		});
		//left图片
		$("#tm1").click(function() {
			location.href="/EasyBuy/BrandServlet?opr=brandIdLists&id=1";
			
			
		});
		$("#tm1").click(function() {
			location.href="/EasyBuy/BrandServlet?opr=brandIdLists&id=2";
			
			
		});
		$("#tm1").click(function() {
			location.href="/EasyBuy/BrandServlet?opr=brandIdLists&id=3";
			
			
		});
		$("#a,#b,#c").click(function() {
			location.href="/EasyBuy/ConmmodityDetailsServlet?opr=productDetils&id=739";
		});
		//特卖商品
		$(".p_sell").html("");
		$.getJSON("SellServlet","opr=sellProductInfos",callBack);
		function callBack(data){
			for(var i=0;i<data.length;i++){
				$(".p_sell").append("<li>"+
						"<div class='img'>"+
							"<img src='/EasyBuy/statics/images/"+data[i].fileName+"' width='160'"+
								"height='140' />"+
						"</div>"+
						"<div class='name'>"+data[i].name+"</div>"+
						"<div class='price'>"+
							"<table border='0' style='width:100%; color:#888888;'"+
								"cellspacing='0' cellpadding='0'>"+
								"<tr style=\"font-family:'宋体';\">"+
									"<td width='33%'>市场价</td>"+
									"<td width='33%'>折扣</td>"+
									"<td width='33%'>为您节省</td>"+
								"</tr>"+
								"<tr>"+
									"<td style='text-decoration:line-through;'>￥"+data[i].price+"</td>"+
									"<td>8.0</td>"+
									"<td>￥"+data[i].zhePrice+"</td>"+
								"</tr>"+
							"</table>"+
						"</div>"+
						"<div class='ch_bg'>"+
							"<span class='ch_txt'>￥<font>"+data[i].xianPrice+"</font>"+
							"</span> <a href='SellServlet?opr=sellProductDetils&id="+data[i].id+"' class='ch_a'>查看</a>"+
						"</div>"+
						"<div class='times'>倒计时：<span class='day_show'></span><span class='hour_show'></span><span class='minute_show'></span><span class='second_show'></span></div></li>");
			}
		}
		//倒计时
		var date1=new Date(); //开始时间
		var date2=new Date("2018-10-21 09:09:09"); //结束时间
		var date3=date2.getTime()-date1.getTime(); //时间差的毫秒数
		//计算出相差天数
		var days=Math.floor(date3/(24*3600*1000));
		//计算出小时数
		var leave1=date3%(24*3600*1000); //计算天数后剩余的毫秒数
		var hours=Math.floor(leave1/(3600*1000));
		//计算相差分钟数
		var leave2=leave1%(3600*1000); //计算小时数后剩余的毫秒数
		var minutes=Math.floor(leave2/(60*1000));
		//计算相差秒数
		var leave3=leave2%(60*1000); //计算分钟数后剩余的毫秒数
		var seconds=Math.round(leave3/1000);
		var st=parseInt(days)*24*60*60+parseInt(hours)*60*60+parseInt(minutes)*60+parseInt(seconds);
		var intDiff = parseInt(st); //倒计时总秒数量
		function timer(intDiff) {
 		window.setInterval(function () {
    		var day = 0,
      		hour = 0,
      		minute = 0,
      		second = 0; //时间默认值
    		if (intDiff > 0) {
      			day = Math.floor(intDiff / (60 * 60 * 24));
      			hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
      			minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
      			second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
    		}
    		if (minute <= 9) minute = '0' + minute;
    		if (second <= 9) second = '0' + second;
    		$('.day_show').html(day + '天');
    		$('.hour_show').html('<s id="h"></s>' + hour + '时');
   			$('.minute_show').html('<s></s>' + minute + '分');
    		$('.second_show').html('<s></s>' + second + '秒');
    		intDiff--;
  		}, 1000);
	}
  	timer(intDiff);
  	
  	
	//热销品牌
	$(".s_hot_brand").html("");
	$.getJSON("SellServlet","opr=sellHotBrand",callBackHotBrand);
	function callBackHotBrand(dataHot){
		for(var i=0;i<dataHot.length;i++){
			$(".s_hot_brand").append("<li><a href='BrandServlet?opr=brandIdLists&id="+dataHot[i].brand_id+"'><img"+
								" src='/EasyBuy/statics/images/"+dataHot[i].brand_url+"' width='160' height='59' />"+
						"</a>"+
						"</li>");
		}
	}
		
	});
</script>
<body>
<c:if test="${list1==null }">
	<%
		request.getRequestDispatcher("/IndexServlet?opr=type&hre=Sell").forward(request, response);
	 %>
</c:if>
	<!-- 头部 -->

	<%@ include file="../../common/header.jsp"%>
	<%@ include file="../../common/preHeader.jsp"%>
	<!--Begin Header Begin-->
	<!--End Menu End-->
	<div class="i_bg">
		<!--Begin Banner Begin-->
		<div class="n_ban">
			<div class="top_slide_wrap">
				<ul class="slide_box bxslider">
					<li><a href="#" 
						style="background:url(/EasyBuy/statics/images/n_ban.jpg) no-repeat center top;" class="im"/>banner1</a>
					</li>
					<li><a href="#"
						style="background:url(/EasyBuy/statics/images/n_ban.jpg) no-repeat center top;"  class="im">banner2</a>
					</li>
					<li><a href="#"
						style="background:url(/EasyBuy/statics/images/n_ban.jpg) no-repeat center top;"  class="im" >banner3</a>
					</li>
				</ul>
				<div class="op_btns clearfix">
					<a href="#" class="op_btn op_prev"><span></span>
					</a> <a href="#" class="op_btn op_next"><span></span>
					</a>
				</div>
			</div>
		</div>
		<script type="text/javascript">
    //var jq = jQuery.noConflict();
    (function(){
        $(".bxslider").bxSlider({
            auto:true,
            prevSelector:jq(".top_slide_wrap .op_prev")[0],nextSelector:jq(".top_slide_wrap .op_next")[0]
        });
    })();
    </script>
		<!--End Banner End-->

		<div class="content mar_10">
			<!--Begin 特卖 Begin-->
			<div class="s_left">
				<div class="brand_t">品牌特卖</div>
				<ul class="sell_brand">
						
				</ul>
				<div class="brand_t">商品特卖</div>
				<ul class="p_sell">
					
				</ul>

			</div>
			<!--End 特卖 End-->

			<div class="s_right">
				<div class="sell_ban">
					<div id="imgPlays">
						<ul class="imgs" id="actors">
							<li><a ><img
									src="/EasyBuy/statics/images/tm_ban.jpg" width="300"
									height="352" id="a"/>
							</a>
							</li>
							<li><a ><img
									src="/EasyBuy/statics/images/tm_ban.jpg" width="300"
									height="352" id="b"/>
							</a>
							</li>
							<li><a><img
									src="/EasyBuy/statics/images/tm_ban.jpg" width="300"
									height="352" id="c"/>
							</a>
							</li>
						</ul>
						<div class="prev_s">上一张</div>
						<div class="next_s">下一张</div>
					</div>
				</div>
				<div class="sell_hot">
					<div class="s_hot_t">
						<span class="fl">热销品牌</span> <span class="h_more fr"><a
							href="/EasyBuy/pre/product/Brand.jsp">更多</a>
						</span>
					</div>
					<ul class="s_hot_brand">
						
					</ul>
				</div>
				<div class="sell_tel">
					<table border="0" style="width:280px; margin:15px auto;"
						cellspacing="0" cellpadding="0">
						<tr valign="top">
							<td width="170"><img src="/EasyBuy/statics/images/tm_1.png" id="tm1"/>
							</td>
							<td>客服在线时间 <br /> 每天09:00 - 18:00</td>
						</tr>
						<tr valign="top">
							<td colspan="2" style="padding-left:58px; padding-top:10px;">
								<span style="color:#ff4e00; font-size:20px;">400-123-4567</span><br />
								客服热线（免费长途）</td>
						</tr>
					</table>
				</div>
				<div class="sell_tel">
					<table border="0" style="width:280px; margin:15px auto;"
						cellspacing="0" cellpadding="0">
						<tr valign="top">
							<td width="170"><img src="/EasyBuy/statics/images/tm_2.png" id="tm2"/>
							</td>
							<td>享受VIP专属特权</td>
						</tr>
					</table>
				</div>
				<div class="sell_tel">
					<table border="0" style="width:280px; margin:15px auto;"
						cellspacing="0" cellpadding="0">
						<tr valign="top">
							<td width="170"><img src="/EasyBuy/statics/images/tm_3.png" id="tm3"  />
							</td>
							<td>客服在线时间<br /> 每天09:00 - 18:00</td>
						</tr>
					</table>
				</div>
			</div>
		</div>

		<!--End 猜你喜欢 End-->

		<%@ include file="../../common/footer.jsp"%>

		<!-- 脚部 -->
	</div>
</body>
</html>
